﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KPIS.GERP.SERVICE.DAL;
using KPIS.GERP.SERVICE.BLL;
using KPIS.GERP.SERVICE.Model;

namespace KPIS.GERP.SERVICE.BLL
{
    public class BLLMessage
    {
        DAL.Message dalMessage = new DAL.Message();

        public List<message> GetMessage(string message_seq, string from_emp_seq, string to_emp_seq
            , string from_message_seq, string task_approve_seq, string rule_approve_seq
            , bool isGetReference, bool isGetFromEmployee, bool isGetToEmployee, bool isGetFromMessage
            , bool isGetRuleApprove, bool isGetTaskApprove, out string strError)
        {
            strError = string.Empty;
            List<message> messageModel = dalMessage.GetMessage(message_seq, from_emp_seq, to_emp_seq
            , from_message_seq, task_approve_seq, rule_approve_seq
            , isGetReference, isGetFromEmployee, isGetToEmployee, isGetFromMessage
            , isGetRuleApprove, isGetTaskApprove);

            if (messageModel.Count > 0)
            {
            }
            else
            {
                strError = Common.ErrorEmptyData;
            }

            return messageModel;
        }


        public void WarnMessage(int warnCount, string empSeq, string updateBy)
        {
            dalMessage.WarnMessage(warnCount, empSeq, updateBy);
        }

        public void MarkHasBeenRead(int messageSeq, int empSeq)
        {
            dalMessage.ReadMessage(messageSeq.ToString(), empSeq.ToString());
        }
    }
}
